home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / fhard101.zip / VHARD.DOC < prev    next >
Text File  |  1990-07-22  |  10KB  |  216 lines

  1.  
  2. ==============================================================================
  3. =                                                                            =
  4. =                                 VHARD.DOC                                  =
  5. =                                                                            =
  6. =           Documentation for VHARD.SYS and associated utilities             =
  7. =                                                                            =
  8. =                          Public Domain Software                            =
  9. =                                                                            =
  10. =                                    by                                      =
  11. =                                                                            =
  12. =                             Aaron L. Brenner                               =
  13. =                                 July 1990                                  =
  14. =                                                                            =
  15. =                            BIX user albrenner                              =
  16. =                       GEnie mail address A.BRENNER                         =
  17. ==============================================================================
  18.  
  19. =Dedication=
  20.     This documentation and all the accompanying software (VHARD.SYS,
  21. VHPREP.EXE, VHCACHE.EXE, and all associated source code) are hereby released
  22. to the public domain.
  23.  
  24. =Background=
  25.         I hate doing backups. Since I don't have a commercial backup program
  26. (and I refuse to use the brain-damaged BACKUP that comes with DOS), I have to
  27. split large files to fit on my 360KB diskettes. That gets to be a real pain.
  28.  
  29.         One day, I got an idea: how about a device driver that makes my A:
  30. drive look like a small (and very slow) hard disk? It would allow me to easily
  31. backup those big files without the hassle of manually splitting them up. With
  32. that idea in mind, I sat down and wrote VHARD.
  33.  
  34.  
  35. =VHARD.SYS=
  36.  
  37.         VHARD.SYS is a device driver that provides another drive to DOS.
  38. Version 1.00 allows for 13 360KB diskettes, giving 5,304,320 bytes of space.
  39. Later versions will allow for different diskette formats.
  40.  
  41.         To install VHARD.SYS, you need to put a line in your CONFIG.SYS like
  42. this
  43.         DEVICE=VHARD.SYS
  44.  
  45. and reboot. At that point, you will have another drive recognized by DOS. You
  46. can copy files to and from the drive, run CHKDSK on the drive, list the
  47. directory of the drive, and so on. As far as DOS is concerned, it's a
  48. removable 5MB disk.
  49.  
  50.  
  51. =VHPREP.EXE=
  52.  
  53.         Before you can actually use a set of floppies with VHARD, they must be
  54. prepared by VHPREP. Each floppy will be formatted and stamped with a disk ID
  55. and serial number.
  56.  
  57.         The command syntax for VHPREP is
  58.  
  59.         VHPREP [<disk ID> [<disk number>]]
  60.  
  61.         <disk ID> is an optional 8-character identification tag that will be
  62.         put on each diskette in the set.
  63.  
  64.         <disk number> is the optional disk number. It can only be used in
  65.         conjuction with the <disk ID> option, and indicates to VHPREP that you
  66.         only want to prepare 1 diskette.
  67.  
  68.         If you don't give VHPREP a specific disk ID to use, it will build a
  69.         funny-looking one based on the current system time (VH0BF10D, for
  70.         instance).
  71.  
  72.         When run, VHPREP will prompt you to put a diskette in drive A:, then
  73. press a key. VHPREP will then format the diskette, and write the disk ID and
  74. disk number. Also, if it is the first disk of the set (disk 0), VHPREP will
  75. also write a DOS boot sector, 2 empty FATs, and a root directory containing
  76. the disk ID as the volume label. Once the diskette has been prepared, VHPREP
  77. will tell you how to label it.
  78.  
  79.  
  80. =VHCACHE.EXE=
  81.  
  82.         To minimize floppy-swapping when copying files to the VHARD drive, 
  83. VHCACHE provides a read/write cache of the FAT and root directory.
  84.  
  85.         The command syntax for VHCACHE is
  86.  
  87.         VHCACHE [? | INFO | ON | OFF | MANUAL | AUTO | FLUSH]
  88.  
  89.         ? and INFO will cause VHCACHE to display information about the cache.
  90.  
  91.         ON will install and enable the cache.
  92.  
  93.         OFF will disable the cache and remove it from memory.
  94.  
  95.         AUTO will cause the cache to be written to disk automatically if the
  96.         DOS version is 3.00 or greater AND SHARE is installed. In this case,
  97.         DOS will tell the VHARD driver when it is opening and closing files,
  98.         so the driver can know when it needs to update the FAT and root
  99.         directory.
  100.  
  101.         MANUAL will disable AUTO, forcing you to tell VHARD when to write the
  102.         cache to disk.
  103.  
  104.         FLUSH is how you tell VHARD to write the cache to disk.
  105.  
  106.         If you don't give VHCACHE any parameters, it will display a brief
  107.         usage message.
  108.  
  109.         * * * * * * * * * * * * * WARNING!!! * * * * * * * * * * * * *
  110.  
  111.         If you intend to run a program that will be using absolute disk
  112.         sectors (a defragger, for instance) with the VHARD drive, DISABLE THE
  113.         CACHE FIRST! The cache-handling code in VHARD.SYS is *very* simple-
  114.         minded. DOS only reads and writes the FATs and root directory a few
  115.         sectors (at most) at a time, so VHARD will only work properly if the
  116.         data to be read or written fall entirely within or outside tha cache.
  117.         This warning applies to reading or writing absolute sectors from
  118.         within DEBUG and SYMDEB as well.
  119.  
  120.         If you don't know what I'm talking about, that's all right. Just
  121.         remember: if you're going to do something that could be dangerous with
  122.         a normal disk, disable the cache first.
  123.  
  124.  
  125. =Technical info=
  126.  
  127.     *   Each diskette in the set is formatted to 10 sectors per track, 40
  128.         tracks, 512 bytes per sector. This gives 799 usable sectors on each
  129.         diskette.
  130.  
  131.     *   VHARD.SYS actually contains 2 device drivers - a block driver that
  132.         provides the support for the virtual hard drive, and a character
  133.         driver that provides functions for dealing with the non-standard
  134.         diskettes. This driver is named VHARDCTL. The provided source code
  135.         fully describes the operation and use of this driver, but I'll repeat
  136.         some of it here.
  137.  
  138.         All commands are sent to VHARDCTL via DOS' IOCTL function (44h). The
  139.         usual sequence of operations is something like this:
  140.  
  141.         vhctl_name      db      'VHARDCTL',0    ; Name of the driver
  142.         vhctl_command   VH_CMD <>               ; Defined in VHARD.INC
  143.         our_drive       db      0ffh            ; Drive assigned (DOS 3.10+)
  144.         vhard_version   dw      0               ; VHARD.SYS version
  145.         vhard_BPB       DOS_BPB <>              ; Defined in DD_DEFS.INC
  146.  
  147.                 . . . . .
  148.  
  149.                 mov     dx,offset vhctl_name    ; Tell DOS to open it
  150.                 mov     ax,3d02                 ;  for read/write
  151.                 int     21h                     ;
  152.                 jc      not_there               ; If it fails, driver isn't
  153.                                                 ;  loaded
  154.                 mov     bx,ax                   ; Get the handle DOS returned
  155.                 mov     ax,4400h                ; IOCTL - Get Device Info
  156.                 int     21h                     ;
  157.                 test    dl,80h                  ; Test the "ISDEV" bit
  158.                 jz      not_there               ; If it isn't a device, the
  159.                                                 ; driver isn't loaded
  160.                 . . . . .
  161.  
  162.                 mov     vhctl_command.VC_cmd_code,CMD_GETDATA
  163.                 mov     word ptr vhctl_command.VC_buffer[0],offset our_drive
  164.                 mov     word ptr vhctl_command.VC_buffer[2],ds
  165.                 mov     dx,offset vhctl_command ; Data to write (BX = handle)
  166.                 mov     cx,size VH_CMD          ; Number of bytes to write
  167.                 mov     ax,4403h                ; IOCTL write
  168.                 int     21h                     ;
  169.  
  170.         VHARDCTL supports the following commands:
  171.  
  172.         Format T